#include<iostream>
using namespace std;

int memo[1000];
int fib(int n) 
{
	if (memo[n] != -1) return memo[n];
	if (n < 3)
		return n;
	memo[n] = fib(n - 1) + fib(n - 2);
	return memo[n];
}
int main()
{
	memset(memo,-1,sizeof(memo));
	cout << fib(4) << endl;
	return 0;
}